Skip to main content

CustomChartContextProps

CustomChartContextProps : {allowedConfigurations?: AllowedConfigurations , chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[] , chartConfigParameters?: ChartConfigParameters , getDefaultChartConfig: (chartModel: ChartModel ) : ChartConfig[] , getQueriesFromChartConfig: (chartConfig: ChartConfig[] , chartModel: ChartModel ) : Query[] , renderChart: (ctx: CustomChartContext ) : Promise< void > , validateConfig?: (updatedConfig: ChartConfig[] , chartModel: ChartModel ) : ValidationResponse , validateVisualProps?: (updatedVisualProps: VisualProps , chartModel: ChartModel , activeColumnId?: string ) : ValidationResponse , visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition }

Defined in : link:https://github.com/thoughtspot/ts-chart-sdk/blob/f477c20/src/main/custom-chart-context.ts#L171

Parameters

allowedConfigurations

allowedConfigurations: AllowedConfigurations

Optional

Optional configuration to toggle native TS UI configurations, such as column number formatting and conditional formatting.

chartConfigEditorDefinition

chartConfigEditorDefinition: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[]

Optional

Definition to help edit/customize the chart config from chart config editor on the TS app. If not provided, chart queries will not be configurable in editor

chartConfigParameters

chartConfigParameters: ChartConfigParameters

Optional

Optional parameters for configuring specific chart-related features, such as measure name and value columns.

getDefaultChartConfig

getDefaultChartConfig: (chartModel: ChartModel ) : ChartConfig[] (chartModel: ChartModel ) : ChartConfig[]

Generate the default axis configuration for rendering the chart on first load.

Function Parameters

chartModel:::

Returns

ChartConfig[]

getQueriesFromChartConfig

getQueriesFromChartConfig: (chartConfig: ChartConfig[] , chartModel: ChartModel ) : Query[] (chartConfig: ChartConfig[] , chartModel: ChartModel ) : Query[]

Generate query in the form of array of chart columns to fetch the data.

Function Parameters

chartConfig:::

chartModel:::

Returns

Query[]

renderChart

renderChart: (ctx: CustomChartContext ) : Promise< void > (ctx: CustomChartContext ) : Promise< void >

Main Render function that will render the chart based on the chart context provided

Function Parameters

ctx:::

the chart context sdk object

Returns

Promise< void >

validateConfig

validateConfig: (updatedConfig: ChartConfig[] , chartModel: ChartModel ) : ValidationResponse

Optional

(updatedConfig: ChartConfig[] , chartModel: ChartModel ) : ValidationResponse

Required to validate the current chart configuration that chart user has updated on the chart config editor

Function Parameters

updatedConfig:::

chartModel:::

Returns

ValidationResponse

validateVisualProps

validateVisualProps: (updatedVisualProps: VisualProps , chartModel: ChartModel , activeColumnId?: string ) : ValidationResponse

Optional

(updatedVisualProps: VisualProps , chartModel: ChartModel , activeColumnId?: string ) : ValidationResponse

Required to validate the custom visual props that the chart user has updated on the chart settings editor.

Function Parameters

updatedVisualProps:::

chartModel:::

activeColumnId::: Optional

  • activeColumnId: string

Returns

ValidationResponse

visualPropEditorDefinition

visualPropEditorDefinition: VisualEditorDefinitionSetter | VisualPropEditorDefinition

Optional

Definition to help edit/customize the visual properties from chart settings editor on the TS app. If not provided, visual properties will not be configurable in editor